package com.hlk.controller.user;

import com.hlk.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author hlk
 * @version 1.0
 * @date 2021-01-08 10:48
 */
@Api(value = "粉丝管理", tags = {"粉丝管理功能的controller"})
@RequestMapping("fans")
public interface MyFansControllerApi {
    @ApiOperation(value = "查询当前用户是否关注作家")
    @PostMapping("/isMeFollowThisWriter")
    Result isMeFollowThisWriter(@RequestParam String writerId, @RequestParam String fanId);

    @ApiOperation(value = "用户关注作家，成为粉丝")
    @PostMapping("/follow")
    Result follow(@RequestParam String writerId, @RequestParam String fanId);

    @ApiOperation(value = "取消关注，作家损失粉丝")
    @PostMapping("/unfollow")
    Result unfollow(@RequestParam String writerId, @RequestParam String fanId);

    @ApiOperation(value = "查询我的所有粉丝列表")
    @PostMapping("/queryAll")
    Result queryAll(@RequestParam String writerId,
                    @ApiParam(name = "page", value = "查询下一页的第几页", required = false)
                    @RequestParam Integer page,
                    @ApiParam(name = "pageSize", value = "分页查询每一页显示的条数", required = false)
                    @RequestParam Integer pageSize);

    @ApiOperation(value = "查询男女粉丝数量")
    @PostMapping("/queryRatio")
    Result queryRatio(@RequestParam String writerId);

    @ApiOperation(value = "根据地域查询粉丝数量")
    @PostMapping("/queryRatioByRegion")
    Result queryRatioByRegion(@RequestParam String writerId);
}
